package o2o.web.actions.service;

import o2o.web.actions.sdk.marketing.v2.service.notice.NoticeMsgWarnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Jahnke【1029777564@qq.com】
 * @ClassName MarketingOrderService
 * @Description:
 * @date 2020/2/1 20:15
 * @Version 1.0
 */
@Service
public class MarketingOrderService {

    @Autowired
    private NoticeMsgWarnService noticeMsgWarnService;

    // 超时订单通知
    public void deliveryTimeOutWarnNotice(String sysCustomer, String content, String orderNo, Long shopId, String toUser) {
        noticeMsgWarnService.setContent(content);
        noticeMsgWarnService.setIdentify(orderNo);
        noticeMsgWarnService.setShopId(shopId == null || shopId <= 0 ? 0 : shopId);
        noticeMsgWarnService.setToUsers(toUser);
        noticeMsgWarnService.setType("delivery-timeout");

        noticeMsgWarnService.sendMsg(sysCustomer);
    }

    // 测试数据发送
    public void sendTest() {
        this.deliveryTimeOutWarnNotice("o2o-onetime", "订单超时-测试",
                "12344", 1L, null);
    }
}
